﻿using CIS.Common.Entitys;
using Microsoft.EntityFrameworkCore;

namespace CIS.Server.EFCore
{
    public class CISServerContext : DbContext
    {
        public CISServerContext()
        {
                
        }

        public CISServerContext(DbContextOptions<CISServerContext> options) : base(options)
        {

        }

        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        {
            //base.OnConfiguring(optionsBuilder);
            //optionsBuilder.UseSqlServer("Server=localhost;Database=cisserver;TrustServerCertificate=true;Trusted_Connection=True;User Id=sa;Password=123456");
            optionsBuilder.UseSqlite("Data Source=D:\\cisserver.db");
        }
        //public DbSet<ProcessProgramEntity>? ProcessPrograms { get; set; }

        //public DbSet<PPIDMappingEntity>? PPIDMappings { get; set; }

        public DbSet<InlineToolEntity>? InlineTools { get; set; }
        public DbSet<PortEntity>? Ports { get; set; }
        public DbSet<PPIDMappingEntity>? PPIDMappings { get; set; }
        public DbSet<ProcessProgramEntity>? ProcessPrograms { get; set; }
        public DbSet<RecipeEntity>? Recipes { get; set; }
        public DbSet<RecipeParameterEntity>? RecipeParameters { get; set; }
        public DbSet<SubUnitEntity>? SubUnits { get; set; }
        public DbSet<UnitEntity>? Units { get; set; }
        public DbSet<JobEntity>? Jobs { get; set; }
    }
}
